/**
 * Copyright ©2016-2020 northkingbpo Corporation, All Rights Reserved
 * http://www.northkingbpo.net/
 */
package profile.hujia.http.client.jersey.config;

import org.glassfish.jersey.client.ClientConfig;
import org.glassfish.jersey.client.ClientProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;

/**
 * class info
 *
 * @author hujia
 * @date 2018/10/26 21:45
 */
@Configuration
public class JerseyConfig {

    @Bean
    public Client jerseyClient() {
        ClientConfig config = new ClientConfig()
                .property(ClientProperties.CONNECT_TIMEOUT, 2000)
                .property(ClientProperties.READ_TIMEOUT, 5000);
        return ClientBuilder.newClient(config);
    }
}
